package com.stockz.equity.charting.display.indicator;

import com.stockz.equity.charting.display.AbstractDisplayableConfiguration;
import com.stockz.equity.indicator.Indicator;
import com.stockz.equity.model.Bar.BarValueType;

@SuppressWarnings("unchecked")
public abstract class AbstractDisplayableIndicatorConfiguration extends
		AbstractDisplayableConfiguration {

	private double[] values;

	public double[] getValues() {
		return values;
	}

	public void setValues(double[] values) {
		this.values = values;
	}
	
	@Override
	public String toString() {
		return getFullName();
	}
	
	@Override
	public void refreshValues() {
		setValues(
				getIndicator().getValues(
						getStockChartView().getSelectedStockChart()
						.getStockChartPanel().getStockChartPanelState()
						.getBarList()));
	}
	
	@SuppressWarnings("rawtypes")
	public abstract Indicator getIndicator();
	
	@Override
	public BarValueType getBarValueType() {
		return getIndicator().getBarValueType();
	}

	@Override
	public void setBarValueType(BarValueType barValueType) {
		getIndicator().setBarValueType(barValueType);
	}
	
	@Override
	public Object getConfiguration() {
		return getIndicator().getIndicatorConfiguration();
	}
}
